package ink.ykb.demo.permission.dao;
import java.util.List;

import org.beetl.sql.core.annotatoin.Sql;
import org.beetl.sql.core.mapper.BaseMapper;

import ink.ykb.demo.permission.entity.UserDealerDepartment;

/*
* 
* gen by beetlsql mapper 2019-09-23
*/
public interface UserDealerDepartmentDao extends BaseMapper<UserDealerDepartment> {

	
	/**
	 * 根据用户ID获取关联配置(加锁)
	 * @param userId
	 * @return
	 */
	@Sql("select * from user_dealer_department where user_id = ? for update")
	UserDealerDepartment getByUserIdAndLock(Long userId);
	
	/**
	 * 根据用户ID获取关联配置
	 * @param userId
	 * @return
	 */
	@Sql("select * from user_dealer_department where user_id = ?")
	UserDealerDepartment getByUserId(Long userId);
	
	/**
	 * 根据部门ID获取关联配置
	 * @param dealerDepartmentId
	 * @return
	 */
	@Sql("select * from user_dealer_department where dealer_department_id = ?")
	List<UserDealerDepartment> getByDealerDepartmentId(Long dealerDepartmentId);
	
	@Sql("select * from user_dealer_department where id = ?")
	UserDealerDepartment getById(Long id);
	
}
